﻿namespace HRM.CORE
{
    using DevExpress.XtraEditors;
    
    using System; using Extra.ERP;
    using System.ComponentModel;
    using System.Drawing;
    using System.Runtime.CompilerServices;
    using System.Windows.Forms; using Common;
    using APP.HELPER.Utils.Language;

    public class xfmSalary : XtraForm
    {
        private IContainer components = null;

        public event PayEventHander PayEvented;

        public xfmSalary()
        {
            this.InitializeComponent();
            this.Text = MultiLanguages.GetString("tbl_Salary", "Payroll", this.Text);
            base.Load += new EventHandler(this.xfmSalary_Load);
        }

        protected override void Dispose(bool disposing)
        {
            if (disposing && (this.components != null))
            {
                this.components.Dispose();
            }
            base.Dispose(disposing);
        }

        private void InitializeComponent()
        {
            base.SuspendLayout();
            base.AutoScaleDimensions = new SizeF(6f, 13f);
            base.AutoScaleMode = AutoScaleMode.Font;
            base.ClientSize = new Size(0x350, 0x22b);
            base.Name = "xfmSalary";
            this.Text = "Bảng T\x00ednh Lương Th\x00e1ng";
            base.ResumeLayout(false);
        }

        private void RaisePayEventHander(int Month, int Year)
        {
            if (this.PayEvented != null)
            {
                this.PayEvented(this, Month, Year);
            }
        }

        private void xfmSalary_Load(object sender, EventArgs e)
        {
            xucSalary salary = new xucSalary();
            salary.Closed += s => base.Close();
            salary.PayEvented += (s, m, y) => this.RaisePayEventHander(m, y);
            salary.Dock = DockStyle.Fill;
            base.Controls.Add(salary);
        }

        public delegate void PayEventHander(object sender, int Month, int Year);
    }
}

